/**
 * @file   object.h
 * @author Carlos Hernández García <carloshergar@usal.es>, Camilo Ruiz, Enrique Conejero
 * @date   Fri Apr  10 2009  
 *
 * Copyright (c) 2009 Carlos Hernández García
 *
 * @brief  This library provides the two main objects of the PIC code: cell and particles. Each cell has two members, 
 * called vertex and center, that especifies the location of the parameters.
 *
 * 
 * Carlos Hernández García                          \n
 * <carloshergar@usal.es>                           \n
 * Universidad de Salamanca                         \n
 * Plaza de la Merced s/n                           \n
 * E-37008 Salamanca, SPAIN                         \n
 */
/********************************************************************************/

#include "constants.h"
#include <iostream>
 


class vertexcell
{
	public:
		double x;					/**< position of the vertex of the cell */ 
		
		double Ex,Ey,Ez,Bx,By,Bz;   /**< fields */
		double Fp,Fm,Gp,Gm;			/**< parameters used for the field calculation */
		double Jx;					/**< current in the longitudinal direction, x */
		
};
/*! \class vertexcell object.h "include/object.h" 
 * \brief Class representing the vertex of the PIC cell. 
 */

class centercell
{
	public:
		double x;				/**< position of the center of the cell */ 
			
		double Rox;				/**< negative x-charge */ 
		double Roy;				/**< negative y-charge */ 
		double Roz;				/**< negative z-charge */ 
		double Ropx;			/**< positive x-charge */
		double Ropy;			/**< positive y-charge */
		double Ropz;			/**< positive z-charge */
		double Jy;				/**< current in the trasnverse direction, y */
		double Jz;				/**< current in the trasnverse direction, z */
};
/*! \class centercell object.h "include/object.h" 
 * \brief Class representing the center of the PIC cell. 
 */ 

class cell1d
{
	public:
		vertexcell vx; /**< vertex of the cell */ 
		centercell ct; /**< center of the cell */ 
		
		cell1d();
};
/*! \class cell1d object.h "include/object.h" 
 * \brief Class representing a cell of the PIC grid. 
 * 
 * In this cell we define all the parameters that we need for the calculation,
 * involving fields, currents and charges.
 */ 


class particle 
{
	
	public:
		//int             number;        // number of this particle
		int species;					 /**< particle species, 0=electron, 1=ion */
		//struct cell     *cell;         // pointer to the cell this particle belongs to
		//struct particle *prev;         // pointer to the previous particle in this cell
		//struct particle *next;         // pointer to the next particle in this cell
		
		int fix;						/**< fixed species? 0->no, 1->yes */
		double q;                       /**< charge of the micro particle in units of e */
		double m;                       /**< mass of the micro particle in units of m_e */
		double qm;                      /**< specific charge, z/m */
		double xp;						/**< position of the particle*/
		double xpold;					/**< older position, within one time step*/
		double vpx;						/**< velocity in the x-direction */
		double vpy;						/**< velocity in the y-direction */
		double vpz;						/**< velocity in the z-direction */
		//double n;                      // particle density in units of n_c
		double zn;                      /**< contribution of the particle to the charge density */
		// in units of n_c ( = z * n )
		
		particle();
		particle(int _species, int _fix, double _xp, double _xpold, double _vpx, double _vpy, double _vpz);
		double igamma();                /**< inverse gamma factor, dinamically calculated */
		
};
/*! \class particle object.h "include/object.h" 
 * \brief Class representing a particle. 
 * 
 * This class correspond to the real particles that we have, in which the positions and velocities are
 * real, and may be distinguish to the positions of the cells. Each particle is placed in a cell.
 */ 



